package com.ama.stock;

import java.util.Date;

import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.datastore.Entity;

public class Datastore {

	static void addOrder(String produit, String at, float achat, float turbo){
		DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();


		Entity order = new Entity("Order");
		order.getKey();

		order.setProperty("Produit", produit);
		order.setProperty("Sens", at);
		order.setProperty("Achat", achat);
		order.setProperty("AchatTurbo", turbo);

		Date buyDate = new Date();
		order.setProperty("dateAchat", buyDate);

		//order.setProperty("attendedHrTraining", true);


		datastore.put(order);
		
		//Entity employee = datastore.get(employeeKey);
	}
	
	static void updateLastOrder(String produit, float vente, float turbo){
		
	}
	
	static Entity getLastOrder(String produit){
		//DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();

		return new Entity("Order");
	}
}
